package com.mazsn.web;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.mazsn.entity.User;
import com.mazsn.service.UserService;

@RestController
@RequestMapping("/user/*")
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping("list")
    public List<User> list() {
        try {
        	 return  userService.list();
        } catch (Exception e) {
            return  new ArrayList<User>();
        }
    }

}